//
//  WSAddCVTypeSubCell.m
//  LANGirl
//
//  Created by 吴帅 on 16/3/19.
//
//

#import "WSAddCVTypeSubCell.h"

//#define MAINBACKCOLOR [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1]


@interface WSAddCVTypeSubCell ()


@end

@implementation WSAddCVTypeSubCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentView.backgroundColor = LV;
        [self createSubView];
    }
    return self;
}

- (void)createSubView {

    self.contentView.layer.cornerRadius = 5;
    self.contentView.layer.masksToBounds = YES;
    self.contentView.layer.borderWidth = 1;
    self.contentView.layer.borderColor = [UIColor clearColor].CGColor;
    
    self.contentLabel = [[UILabel alloc] init];
    self.contentLabel.textColor = ZI;
    self.contentLabel.userInteractionEnabled = YES;
    self.contentLabel.font = [UIFont systemFontOfSize:TEXTCONTENTFONT2 * TEXTWEIGHT];
    [self.contentView addSubview:_contentLabel];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.right.bottom.top.mas_equalTo(@0);
    }];
    self.contentLabel.textAlignment = NSTextAlignmentCenter;
}

- (void)setContentStr:(NSString *)contentStr {

    _contentStr = contentStr;
    self.contentLabel.text = _contentStr;
}

- (void)changeColor:(BOOL)isChange {

    if (isChange) {
        [UIView animateWithDuration:0.3 animations:^{
            
                self.contentView.backgroundColor = GH;
            self.contentLabel.textColor = [UIColor whiteColor];
            
        }];
    }
    else {
        self.contentView.backgroundColor = LV;
        self.contentLabel.textColor= ZI;
    }
}

- (void)changeBorderColor:(BOOL)isChange {

    if (isChange) {
        self.contentView.layer.borderColor = [UIColor redColor].CGColor;
    }
    else {
        self.contentView.layer.borderColor = [UIColor clearColor].CGColor;
    }
}

@end
